package com.fly.flowdemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.fly.flowdemo.view.ButtonFlowLayout;

public class MainActivity extends AppCompatActivity {

    static final String[] labels = {
            "java", "C", "C++", "php", "swift", "Object-C", "HTML5", "CSS3"
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButtonFlowLayout btnFlow = (ButtonFlowLayout) findViewById(R.id.id_btn_flow);
        btnFlow.setLabels(labels);
        btnFlow.setOnItemClickListener(new ButtonFlowLayout.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                Log.e("tag", "[ " + position + " ]");
            }
        });
    }

}
